﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Investor.aspx.cs" Inherits="Investor" %>

<%@ Register Assembly="Infragistics4.WebUI.WebResizingExtender.v10.3, Version=10.3.20103.1013, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb"
    Namespace="Infragistics.WebUI" TagPrefix="igui" %>
<%@ Register Assembly="Infragistics4.Web.v10.3, Version=10.3.20103.1013, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb"
    Namespace="Infragistics.Web.UI.GridControls" TagPrefix="ig" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
    <link href="~/Styles/DivTable.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript">

        //Event when a row of ChuDauTu selected
        function onRowSelectionChanged(wdg, evntArgs) {
            //Get value from row selected
            var selectedID = evntArgs.getSelectedRows().getItem(0).get_cell(0).get_text();
            var selectedName = evntArgs.getSelectedRows().getItem(0).get_cell(1).get_text();
            var selectedAddress = evntArgs.getSelectedRows().getItem(0).get_cell(2).get_text();

            document.getElementById("txtMaChuDauTu").value = selectedID;
            document.getElementById("txtTenChuDauTu").value = selectedName;
            document.getElementById("txtDiaChi").value = selectedAddress;

            // Set selected value for ChuDauTu of parent page
            opener.document.getElementById("txtInvestorID").value = selectedID;
            opener.document.getElementById("txtChuDauTu").value = selectedName;
            opener.document.getElementById("txtDiaChi").value = selectedAddress;
        }
    </script>
    <style type="text/css">
        #form1
        {
            height: 227px;
        }
        .CellTitle
        {
            float: left; /*fix for  buggy browsers*/;
            display: table-column;
            width: 340px;
            text-align: right;
        }
        .CellTitle
        {
            float: left;
            display: table-column;
            width: 557px;
            text-align: right;
        }
        .style1
        {
            float: left;
            display: table-column;
            width: 377px;
            text-align: right;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server" />
    <table class="Main" style="width: 100%;">
        <tr>
            <td colspan="2" align="center">
                <h1>
                    THÔNG TIN CHỦ ĐẦU TƯ
                </h1>
            </td>
        </tr>
        <tr>
            <td class="style1">
                Mã chủ đầu tư:
            </td>
            <td class="CellContent">
                <asp:TextBox ID="txtMaChuDauTu" runat="server" TabIndex="1" Enabled="False"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="style1">
                Tên chủ đầu tư:
            </td>
            <td class="CellContent">
                <asp:TextBox ID="txtTenChuDauTu" runat="server" TabIndex="2"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="style1">
                Địa chỉ:
            </td>
            <td class="CellContent">
                <asp:TextBox ID="txtDiaChi" runat="server" TabIndex="3"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td colspan="2" align="center">
                <ig:WebDataGrid ID="wdg" runat="server" AutoGenerateColumns="False" DataKeyFields="investor_id"
                    Height="172px" Width="623px">
                    <Columns>
                        <ig:BoundDataField DataFieldName="investor_id" Key="investor_id" Header-Text="ID"
                            Width="30px">
                            <Header Text="STT"></Header>
                        </ig:BoundDataField>
                        <ig:BoundDataField DataFieldName="investor_name" Key="investor_name" Header-Text="Name">
                            <Header Text="Tên chủ đầu tư"></Header>
                        </ig:BoundDataField>
                        <ig:BoundDataField DataFieldName="investor_address" Key="investor_address" Header-Text="Address">
                            <Header Text="Địa chỉ"></Header>
                        </ig:BoundDataField>
                    </Columns>
                    <Behaviors>
                        <ig:Activation>
                        </ig:Activation>
                        <ig:Selection CellClickAction="Row" RowSelectType="Single">
                            <AutoPostBackFlags RowSelectionChanged="true" />
                            <SelectionClientEvents RowSelectionChanged="onRowSelectionChanged" />
                        </ig:Selection>
                        <ig:ColumnResizing>
                            <ColumnSettings>
                                <ig:ColumnResizeSetting ColumnKey="investor_id" MaximumWidth="200" MinimumWidth="50" />
                            </ColumnSettings>
                        </ig:ColumnResizing>
                        <ig:EditingCore>
                            <Behaviors>
                                <ig:CellEditing>
                                </ig:CellEditing>
                            </Behaviors>
                        </ig:EditingCore>
                    </Behaviors>
                </ig:WebDataGrid>
            </td>
        </tr>
        <tr>
            <td colspan="2" align="center">
                <asp:Button ID="btnAdd" runat="server" Text="Thêm" TabIndex="3" OnClick="btnAdd_Click">
                </asp:Button>
                <asp:Button ID="btnEdit" runat="server" Text="Sửa" TabIndex="3" OnClick="btnEdit_Click">
                </asp:Button>
                <asp:Button ID="btnSelect" runat="server" Text="Chọn" TabIndex="3" OnClick="btnSelect_Click">
                </asp:Button>
            </td>
        </tr>
    </table>
    </form>
</body>
</html>
